package com.atguigu03.reflectapply.apply1;

import com.atguigu03.reflectapply.data.Person;
import org.junit.Test;

/**
 * ClassName: newInstance
 * Description:
 *
 * @Author liu
 * @Create 2025/4/26 16:44
 * @Version 1.0
 */
public class newInstance {
    @Test
    public void test1() throws InstantiationException, IllegalAccessException {
        Class clazz = Person.class;

        //创建Person类的实例
        Person per = (Person) clazz.newInstance();

        System.out.println(per);
    }
}
